import java.util.HashMap;

public final class ProjectContainer {

	private static ProjectContainer pc;
	private static HashMap<String, Project> projectList = new HashMap<String, Project>();

	private ProjectContainer () {
	}

	public synchronized static ProjectContainer getInstance() {
		if (pc == null)
		{
			pc = new ProjectContainer();
		}
		return pc;
	}

	public void addProject(String id, Project p) {
		projectList.put(id, p);
	}

	public Project getProject(String id) {
		return projectList.get(id);
	}

	public void deleteProject(String id) {
		projectList.remove(id);
	}

	public int getNoOfProjects() {
		return projectList.size();
	}
}
